﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace Metro.Core
{
    public interface IWidget
    {
        event AddContextMenuItemHandler AddContextMenuItem;

        event SetBgBrushHandler SetBgBrush;

        string GetWidgetName();

        UserControl Load();

        UserControl GetWidgetControl();

        void Unload();

        string GetIcon();

        Point GetPosition();

        void SetPosition(int x, int y);
    }

    public abstract class Widget
    {
        public abstract string Name { get; }
        public abstract UserControl WidgetControl { get; }
        public abstract string IconPath { get; }
        public abstract Point Position { get; set; }
        public abstract bool HasHub { get; }
        public abstract UserControl HubControl { get; }

        public abstract void Load();
        public abstract void Unload();

        public abstract event AddContextMenuItemHandler AddContextMenuItem;
        public abstract event SetBgBrushHandler SetBgBrush;
    }

    public delegate void AddContextMenuItemHandler(MenuItem item);

    public delegate void SetBgBrushHandler(Brush brush);
}
